package com.example.demo2.common.config.security.fitler;

import com.example.demo2.common.config.security.WebSecurityConfig;

import java.util.Arrays;

public class FilterUtils {

    public static boolean securityExcludeUrl(String requestURI){
        boolean isStatic = false;
        String[] loginUrl = WebSecurityConfig.loginUrl;
        String[] notFilterUrl = WebSecurityConfig.notFilterUrl;
        String[] staticResource = WebSecurityConfig.staticResource;
        for (String s : staticResource) {
            isStatic =  requestURI.contains(s);
        }
        if(isStatic || Arrays.asList(loginUrl).contains(requestURI)|| Arrays.asList(notFilterUrl).contains(requestURI)){
            return true;
        }
        return false;
    }

}
